package tpo.wmb.provider.service.impl;

import org.springframework.stereotype.Service;
import pojo.Area;
import pojo.User;
import pojo.Useraddress;
import tpo.wmb.provider.dao.UserAddressMapper;
import tpo.wmb.provider.dao.UserMapper;
import tpo.wmb.provider.service.UserService;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    @Resource
    UserAddressMapper userAddressMapper;

    @Override
    public List<User> selectUserList(Map<String, Object> map) {
        return userMapper.selectUserList(map);
    }

    @Override
    public List<User> selectUsers() {
        return userMapper.selectUsers();
    }

    @Override
    public List<Integer> selectUserListInt(String name) {
        return userMapper.selectUserListInt(name);
    }

    @Override
    public User selectUser(Integer id) {
        return userMapper.selectUser(id);
    }

    @Override
    public Integer insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public Integer deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public List<Useraddress> selectAddressList(Integer uid) {
        return userAddressMapper.selectAddressList(uid);
    }


    @Override
    public Useraddress selectAddress(Integer id) {
        return userAddressMapper.selectAddress(id);
    }

    @Override
    public Integer insertAddress(Useraddress useraddress) {
        return userAddressMapper.insertAddress(useraddress);
    }

    @Override
    public Integer updateAddress(Useraddress useraddress) {
        return userAddressMapper.updateAddress(useraddress);
    }

    @Override
    public Integer deleteAddress(Integer id) {
        return userAddressMapper.deleteAddress(id);
    }

    @Override
    public Useraddress selectDefalutAddress(Integer uid) {
        return userAddressMapper.selectDefalutAddress(uid);
    }

    @Override
    public List<Area> selectUserArea(Integer upperLevelID) {
        return userMapper.selectUserArea(upperLevelID);
    }

}
